3.48 \(\int \cos ^2(\sqrt{x}) \, dx\)

Optimal. Leaf size=36 \[ \frac{x}{2}+\frac{1}{2} \cos ^2\left (\sqrt{x}\right )+\sqrt{x} \sin \left (\sqrt{x}\right ) \cos \left (\sqrt{x}\right ) \]

[Out]

x/2 + Cos[Sqrt[x]]^2/2 + Sqrt[x]*Cos[Sqrt[x]]*Sin[Sqrt[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0213152, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.375, Rules used = {3362, 3310, 30} \[ \frac{x}{2}+\frac{1}{2} \cos ^2\left (\sqrt{x}\right )+\sqrt{x} \sin \left (\sqrt{x}\right ) \cos \left (\sqrt{x}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Cos[Sqrt[x]]^2,x]

[Out]

x/2 + Cos[Sqrt[x]]^2/2 + Sqrt[x]*Cos[Sqrt[x]]*Sin[Sqrt[x]]

Rule 3362

Int[((a_.) + Cos[(c_.) + (d_.)*((e_.) + (f_.)*(x_))^(n_)]*(b_.))^(p_.), x_Symbol] :> Dist[1/(n*f), Subst[Int[x
^(1/n - 1)*(a + b*Cos[c + d*x])^p, x], x, (e + f*x)^n], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[p, 0] && In
tegerQ[1/n]

Rule 3310

Int[((c_.) + (d_.)*(x_))*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(d*(b*Sin[e + f*x])^n)/(f^2*n
^2), x] + (Dist[(b^2*(n - 1))/n, Int[(c + d*x)*(b*Sin[e + f*x])^(n - 2), x], x] - Simp[(b*(c + d*x)*Cos[e + f*
x]*(b*Sin[e + f*x])^(n - 1))/(f*n), x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rubi steps

\begin{align*} \int \cos ^2\left (\sqrt{x}\right ) \, dx &=2 \operatorname{Subst}\left (\int x \cos ^2(x) \, dx,x,\sqrt{x}\right )\\ &=\frac{1}{2} \cos ^2\left (\sqrt{x}\right )+\sqrt{x} \cos \left (\sqrt{x}\right ) \sin \left (\sqrt{x}\right )+\operatorname{Subst}\left (\int x \, dx,x,\sqrt{x}\right )\\ &=\frac{x}{2}+\frac{1}{2} \cos ^2\left (\sqrt{x}\right )+\sqrt{x} \cos \left (\sqrt{x}\right ) \sin \left (\sqrt{x}\right )\\ \end{align*}

Mathematica [A]  time = 0.0278696, size = 31, normalized size = 0.86 \[ \frac{1}{4} \left (2 \left (x+\sqrt{x} \sin \left (2 \sqrt{x}\right )\right )+\cos \left (2 \sqrt{x}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[Sqrt[x]]^2,x]

[Out]

(Cos[2*Sqrt[x]] + 2*(x + Sqrt[x]*Sin[2*Sqrt[x]]))/4

________________________________________________________________________________________

Maple [A]  time = 0.026, size = 34, normalized size = 0.9 \begin{align*} 2\,\sqrt{x} \left ( 1/2\,\cos \left ( \sqrt{x} \right ) \sin \left ( \sqrt{x} \right ) +1/2\,\sqrt{x} \right ) -{\frac{x}{2}}-{\frac{1}{2} \left ( \sin \left ( \sqrt{x} \right ) \right ) ^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x^(1/2))^2,x)

[Out]

2*x^(1/2)*(1/2*cos(x^(1/2))*sin(x^(1/2))+1/2*x^(1/2))-1/2*x-1/2*sin(x^(1/2))^2

________________________________________________________________________________________

Maxima [A]  time = 1.07688, size = 31, normalized size = 0.86 \begin{align*} \frac{1}{2} \, \sqrt{x} \sin \left (2 \, \sqrt{x}\right ) + \frac{1}{2} \, x + \frac{1}{4} \, \cos \left (2 \, \sqrt{x}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x^(1/2))^2,x, algorithm="maxima")

[Out]

1/2*sqrt(x)*sin(2*sqrt(x)) + 1/2*x + 1/4*cos(2*sqrt(x))

________________________________________________________________________________________

Fricas [A]  time = 1.60506, size = 86, normalized size = 2.39 \begin{align*} \sqrt{x} \cos \left (\sqrt{x}\right ) \sin \left (\sqrt{x}\right ) + \frac{1}{2} \, \cos \left (\sqrt{x}\right )^{2} + \frac{1}{2} \, x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x^(1/2))^2,x, algorithm="fricas")

[Out]

sqrt(x)*cos(sqrt(x))*sin(sqrt(x)) + 1/2*cos(sqrt(x))^2 + 1/2*x

________________________________________________________________________________________

Sympy [A]  time = 0.386695, size = 51, normalized size = 1.42 \begin{align*} \sqrt{x} \sin{\left (\sqrt{x} \right )} \cos{\left (\sqrt{x} \right )} + \frac{x \sin ^{2}{\left (\sqrt{x} \right )}}{2} + \frac{x \cos ^{2}{\left (\sqrt{x} \right )}}{2} + \frac{\cos ^{2}{\left (\sqrt{x} \right )}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x**(1/2))**2,x)

[Out]

sqrt(x)*sin(sqrt(x))*cos(sqrt(x)) + x*sin(sqrt(x))**2/2 + x*cos(sqrt(x))**2/2 + cos(sqrt(x))**2/2

________________________________________________________________________________________

Giac [A]  time = 1.11741, size = 31, normalized size = 0.86 \begin{align*} \frac{1}{2} \, \sqrt{x} \sin \left (2 \, \sqrt{x}\right ) + \frac{1}{2} \, x + \frac{1}{4} \, \cos \left (2 \, \sqrt{x}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x^(1/2))^2,x, algorithm="giac")

[Out]

1/2*sqrt(x)*sin(2*sqrt(x)) + 1/2*x + 1/4*cos(2*sqrt(x))